<?php

namespace App\Http\Middleware;

use Closure;
use Session;

class Mobilelogin
{
    //夜读书移动端登录中间件

    // protected $auth;

    // public function __construct(Guard $auth)
    // {
    //     $this->auth = $auth;
    // }

    public function handle($request, Closure $next)
    {

        if (Session::has('name')) {
            return $next($request);
        }
        else {
            return redirect()->guest('mobile/login');
        }

        //return $next($request);
    }
}
